-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(filters): prevent crashes when start_date == date.min
#10224
Conversation
Hi there 👋, @DryRunSecurity here, below is a summary of our analysis and findings.
Note 🔴 Risk threshold exceeded. Adding a reviewer if one is configured in notification list: @mtesauro @grendel513 Change Summary (click to expand)The following is a summary of changes in this pull request made by me, your security buddy 🤖. Note that this summary is auto-generated and not meant to be a definitive list of security issues but rather a helpful summary from a security perspective. Summary: The changes in this pull request focus on enhancing the unit tests for the GenericParser class in the The addition of the Additionally, the changes to the Files Changed:
Powered by DryRun Security |
I cannot add the |
Can you also write a unittest for it? If your report contains sensitive info, feel free to anonymize it. |
@kiblik sure thing. Could you guide me a bit on how to do that (or point to a documentation)? Where should I store the scan result to test? |
https://documentation.defectdojo.com/contributing/how-to-write-a-parser/ |
@p-l- your unit test could first create a finding with the "bad date" and then invoke the filter class that you are making the change to in this PR in the same way that the |
f3f4a31
to
f884fb9
Compare
@Maffooch Thanks. It seems that the results are not sent to the database, so my test won't work. Do you have any idea what the easier way to test it could be? |
Could put your test here: https://github.com/DefectDojo/django-DefectDojo/blob/master/unittests/test_finding_model.py |
Closing as stale |
Description
Some reports may include bogus values for
start_date
, like thedate.min
value. In that situation, DefectDojo would crash; the bug is not really in DefectDojo, but a bit of defensive programming won't hurt, and we want to avoid a crash even with invalid data.When that happen, we'll use
date.min
asstart_date
rather thandate.min - timedelta(days=1)
which cannot exist in Python.Test results
We do have an (internal, home made) scanner that (used to) produce such invalid result, and this patch fixes the issue.
Documentation
N/A
Checklist
This checklist is for your information.
dev
bugfix
.bugfix
branch.